<div class="widget" id="template_div">
        <div class="head"><h5 class="iList">Select directory</h5></div>
        <form action="">
            <fieldset>
            
		     	<div class="rowElem noborder">
		     		<div class="formLeft">
							<select id="sl_master_directory" name="sl_master_directory" onchange="loadDirectoryData()">
							<option value="">
                    		--Select--
                    		</option>                    	
                    		<?php 
                    		foreach($directories as $directory){
                    			if (count($directory->getCategory()) > 0){
                    			?>
                    		<option value="<?php echo $directory->getId()?>">
                    			<?php echo $directory->getName()?>
                    		</option>	
                    		<?php 
                    			}
                    		}
                    		?>
                    	</select>		     		
		     		</div>
		     		 
		     		 <div id="sitemaps_info" style=" float: left; font-weight: bold; margin-left: 20px;  margin-top: 5px;"></div>
		     		 
		     		<div class="fix"></div>
		     		
		     		
		     	</div>            
 
            </fieldset>
	</form>
</div>

<div id="test_info"></div>
<script>
function loadDirectoryData (){

	var php_url = '<?php echo url_for('sitemap/getTotalXml?directory_id=')?>';
	var directory_id = document.getElementById('sl_master_directory').value;
	php_url = php_url.concat(directory_id);	

	if (directory_id != ""){
		$.ajax({type: 'POST', url:php_url, script:true, cache:false, 
			success: function(data) { 
				 $('#sitemaps_info').html(data);
				} });
	}else{
		$('#sitemaps_info').html("");
	}
	
}
</script>